Optimal. Leaf size=146 \[ -a^3 x-\frac {9}{2} a b^2 x+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {2 b^3 \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}+\frac {3 a^2 b \sec (c+d x)}{d}+\frac {b^3 \sec (c+d x)}{d}+\frac {a^3 \tan (c+d x)}{d}+\frac {9 a b^2 \tan (c+d x)}{2 d}-\frac {3 a b^2 \sin ^2(c+d x) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 10, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {2801, 3554,
8, 2670, 14, 2671, 294, 327, 209, 276} \begin {gather*} \frac {a^3 \tan (c+d x)}{d}+a^3 (-x)+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {3 a^2 b \sec (c+d x)}{d}+\frac {9 a b^2 \tan (c+d x)}{2 d}-\frac {3 a b^2 \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {9}{2} a b^2 x-\frac {b^3 \cos ^3(c+d x)}{3 d}+\frac {2 b^3 \cos (c+d x)}{d}+\frac {b^3 \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 14
Rule 209
Rule 276
Rule 294
Rule 327
Rule 2670
Rule 2671
Rule 2801
Rule 3554
Rubi steps
\begin {align*} \int (a+b \sin (c+d x))^3 \tan ^2(c+d x) \, dx &=\int \left (a^3 \tan ^2(c+d x)+3 a^2 b \sin (c+d x) \tan ^2(c+d x)+3 a b^2 \sin ^2(c+d x) \tan ^2(c+d x)+b^3 \sin ^3(c+d x) \tan ^2(c+d x)\right ) \, dx\\ &=a^3 \int \tan ^2(c+d x) \, dx+\left (3 a^2 b\right ) \int \sin (c+d x) \tan ^2(c+d x) \, dx+\left (3 a b^2\right ) \int \sin ^2(c+d x) \tan ^2(c+d x) \, dx+b^3 \int \sin ^3(c+d x) \tan ^2(c+d x) \, dx\\ &=\frac {a^3 \tan (c+d x)}{d}-a^3 \int 1 \, dx-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int \frac {1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \text {Subst}\left (\int \frac {x^4}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}-\frac {b^3 \text {Subst}\left (\int \frac {\left (1-x^2\right )^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a^3 x+\frac {a^3 \tan (c+d x)}{d}-\frac {3 a b^2 \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int \left (-1+\frac {1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}+\frac {\left (9 a b^2\right ) \text {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}-\frac {b^3 \text {Subst}\left (\int \left (-2+\frac {1}{x^2}+x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a^3 x+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {2 b^3 \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}+\frac {3 a^2 b \sec (c+d x)}{d}+\frac {b^3 \sec (c+d x)}{d}+\frac {a^3 \tan (c+d x)}{d}+\frac {9 a b^2 \tan (c+d x)}{2 d}-\frac {3 a b^2 \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac {\left (9 a b^2\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-a^3 x-\frac {9}{2} a b^2 x+\frac {3 a^2 b \cos (c+d x)}{d}+\frac {2 b^3 \cos (c+d x)}{d}-\frac {b^3 \cos ^3(c+d x)}{3 d}+\frac {3 a^2 b \sec (c+d x)}{d}+\frac {b^3 \sec (c+d x)}{d}+\frac {a^3 \tan (c+d x)}{d}+\frac {9 a b^2 \tan (c+d x)}{2 d}-\frac {3 a b^2 \sin ^2(c+d x) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.52, size = 113, normalized size = 0.77 \begin {gather*} \frac {b \sec (c+d x) \left (108 a^2+45 b^2+4 \left (9 a^2+5 b^2\right ) \cos (2 (c+d x))-b^2 \cos (4 (c+d x))+9 a b \sin (3 (c+d x))\right )+3 a \left (-4 \left (2 a^2+9 b^2\right ) (c+d x)+\left (8 a^2+27 b^2\right ) \tan (c+d x)\right )}{24 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 169, normalized size = 1.16
method | result | size |
derivativedivides | \(\frac {a^{3} \left (\tan \left (d x +c \right )-d x -c \right )+3 a^{2} b \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+3 a \,b^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) | \(169\) |
default | \(\frac {a^{3} \left (\tan \left (d x +c \right )-d x -c \right )+3 a^{2} b \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+3 a \,b^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+b^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}\) | \(169\) |
risch | \(-a^{3} x -\frac {9 a \,b^{2} x}{2}-\frac {3 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {3 b \,{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 d}+\frac {7 b^{3} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {3 b \,{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}+\frac {7 b^{3} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {3 i a \,b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i a^{3}+6 i a \,b^{2}+6 a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}+2 b^{3} {\mathrm e}^{i \left (d x +c \right )}}{d \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )}-\frac {b^{3} \cos \left (3 d x +3 c \right )}{12 d}\) | \(200\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.59, size = 119, normalized size = 0.82 \begin {gather*} -\frac {6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{3} + 9 \, {\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a b^{2} + 2 \, {\left (\cos \left (d x + c\right )^{3} - \frac {3}{\cos \left (d x + c\right )} - 6 \, \cos \left (d x + c\right )\right )} b^{3} - 18 \, a^{2} b {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 116, normalized size = 0.79 \begin {gather*} -\frac {2 \, b^{3} \cos \left (d x + c\right )^{4} + 3 \, {\left (2 \, a^{3} + 9 \, a b^{2}\right )} d x \cos \left (d x + c\right ) - 18 \, a^{2} b - 6 \, b^{3} - 6 \, {\left (3 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (3 \, a b^{2} \cos \left (d x + c\right )^{2} + 2 \, a^{3} + 6 \, a b^{2}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right )^{3} \tan ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.15, size = 249, normalized size = 1.71 \begin {gather*} \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^3+9\,a\,b^2\right )+12\,a^2\,b+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (2\,a^3+9\,a\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (6\,a^3+15\,a\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (6\,a^3+15\,a\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (24\,a^2\,b+\frac {32\,b^3}{3}\right )+\frac {16\,b^3}{3}+12\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2+9\,b^2\right )}{2\,a^3+9\,a\,b^2}\right )\,\left (2\,a^2+9\,b^2\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________